package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 数据备份记录表
 * @TableName data_backup_record
 */
@TableName(value ="data_backup_record")
@Data
public class DataBackupRecord implements Serializable {
    /**
     * 备份ID
     */
    @TableId(type = IdType.AUTO)
    private Long backupId;

    /**
     * 备份名称
     */
    private String backupName;

    /**
     * 备份类型：1-全量备份，2-增量备份
     */
    private Integer backupType;

    /**
     * 备份范围
     */
    private String backupScope;

    /**
     * 备份文件路径
     */
    private String backupFilePath;

    /**
     * 备份文件大小
     */
    private Long backupFileSize;

    /**
     * 备份开始时间
     */
    private Date backupStartTime;

    /**
     * 备份结束时间
     */
    private Date backupEndTime;

    /**
     * 状态：1-备份中，2-备份成功，3-备份失败
     */
    private Integer status;

    /**
     * 错误信息
     */
    private String errorMessage;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DataBackupRecord other = (DataBackupRecord) that;
        return (this.getBackupId() == null ? other.getBackupId() == null : this.getBackupId().equals(other.getBackupId()))
            && (this.getBackupName() == null ? other.getBackupName() == null : this.getBackupName().equals(other.getBackupName()))
            && (this.getBackupType() == null ? other.getBackupType() == null : this.getBackupType().equals(other.getBackupType()))
            && (this.getBackupScope() == null ? other.getBackupScope() == null : this.getBackupScope().equals(other.getBackupScope()))
            && (this.getBackupFilePath() == null ? other.getBackupFilePath() == null : this.getBackupFilePath().equals(other.getBackupFilePath()))
            && (this.getBackupFileSize() == null ? other.getBackupFileSize() == null : this.getBackupFileSize().equals(other.getBackupFileSize()))
            && (this.getBackupStartTime() == null ? other.getBackupStartTime() == null : this.getBackupStartTime().equals(other.getBackupStartTime()))
            && (this.getBackupEndTime() == null ? other.getBackupEndTime() == null : this.getBackupEndTime().equals(other.getBackupEndTime()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getErrorMessage() == null ? other.getErrorMessage() == null : this.getErrorMessage().equals(other.getErrorMessage()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBackupId() == null) ? 0 : getBackupId().hashCode());
        result = prime * result + ((getBackupName() == null) ? 0 : getBackupName().hashCode());
        result = prime * result + ((getBackupType() == null) ? 0 : getBackupType().hashCode());
        result = prime * result + ((getBackupScope() == null) ? 0 : getBackupScope().hashCode());
        result = prime * result + ((getBackupFilePath() == null) ? 0 : getBackupFilePath().hashCode());
        result = prime * result + ((getBackupFileSize() == null) ? 0 : getBackupFileSize().hashCode());
        result = prime * result + ((getBackupStartTime() == null) ? 0 : getBackupStartTime().hashCode());
        result = prime * result + ((getBackupEndTime() == null) ? 0 : getBackupEndTime().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getErrorMessage() == null) ? 0 : getErrorMessage().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", backupId=").append(backupId);
        sb.append(", backupName=").append(backupName);
        sb.append(", backupType=").append(backupType);
        sb.append(", backupScope=").append(backupScope);
        sb.append(", backupFilePath=").append(backupFilePath);
        sb.append(", backupFileSize=").append(backupFileSize);
        sb.append(", backupStartTime=").append(backupStartTime);
        sb.append(", backupEndTime=").append(backupEndTime);
        sb.append(", status=").append(status);
        sb.append(", errorMessage=").append(errorMessage);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}